package com.xiashitech.agent.instrumentation.base;

import com.xiashitech.agent.rule.usermatch.Register;

import java.util.ArrayList;
import java.util.List;

/**
 * 帮助类的通用获取工具
 * @author zhaoyk
 */
public class InstHelper {

    private static List<String> basicHelpers = new ArrayList<>();

    static {
        basicHelpers.add("com.xiashitech.agent.instrumentation.base.DebugUtils");
        basicHelpers.add("com.xiashitech.agent.instrumentation.base.InstPreparedArgs");
    }

    public static List<String> getHelperClasses(String... classes) {
        return getHelperClasses(false, classes);
    }

    public static List<String> getHelperClasses(boolean withUserMatch, String... classes) {
        List<String> rtn = new ArrayList<>(basicHelpers);

        if(withUserMatch)
            rtn.addAll(Register.registUserMatch());

        for (String cls : classes) {
            rtn.add(cls);
        }

        return rtn;
    }

}
